package com.project.service.service;

import com.project.service.dao.IUserDao;
import com.project.service.server.Request;
import com.project.service.server.Response;
import com.project.service.server.Servlet;
import com.project.service.util.DaoFactory;
import com.project.service.util.WebServlet;

/**
 * 删除业务组件
 */
@WebServlet("del")
public class  DelService implements Servlet {
    private IUserDao dao = (IUserDao) DaoFactory.getDao("IUserDao");
    public void service(Request req, Response resp){
        //得到客户端提交的id
        int id = Integer.parseInt(req.getParameter("id"));

        //调用持久方法，完成删除
        dao.del(id);
        FindAllService findAll = new FindAllService();
        findAll.service(req,resp);
    }
}
